package lambda.demo;

public class Lambda_4 {

//    静态变量
    static int outerStaticNum;
//   成员变量
    int outerNum;

    /***
     * 访问成员变量，了解了如何在Lambda 表达式中访问局部变量。与局部变量
     */
    void testScopes(){
        Converter<Integer,String> stringConverter = (from -> {
           outerNum = 23;
           return String.valueOf(from);
        });


        Converter<Integer,String> stringConverter1 = (from -> {
            outerStaticNum = 72;
            return String.valueOf(from);
        });
    }
}
